package 每日一题OJ;
import java.util.ArrayList;

/**
 * @author shy_black
 * @date 2019/3/18 22:40
 * @Description:
 * 二分法解决，还有暴力枚举法，已上传
 */
public class 旋转数组的最小数字 {

    public int minNumberInRotateArray(int [] array) {
        int low = 0;
        int high = array.length-1;
        while(low < high) {
            int mid = (low + high)/2;
            if(array[mid] < array[high])
                high = mid;
            else
                low = mid+1;
        }
        return array[low];
    }
}